﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:controlsPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls"
    
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" 
    xmlns:System_Windows_Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit" 
    xmlns:Charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
    xmlns:Charting_Primitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
	xmlns:layouttoolkit="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Layout.Toolkit" 
    xmlns:inputtoolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit" 
    xmlns:System_Windows_Controls_Primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Input.Toolkit"
    xmlns:dataformtoolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" 
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:System_Windows_Controls_DataVisualization_Charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
    xmlns:charttoolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
    xmlns:System_Windows_Controls_DataVisualization_Charting_Primitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
	xmlns:System="clr-namespace:System;assembly=mscorlib" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Parameters.xaml"/>
        <ResourceDictionary Source="Brushes.xaml"/>
        <ResourceDictionary Source="CoreStyles.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <!-- Chart Style-->
    <Style x:Key="DataPointStyle1" TargetType="Control">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Control">
                    <Grid x:Name="root">

                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal"/>
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Hover"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1" Duration="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="SelectionStates">
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Select"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1" Duration="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unselected" />
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="RevealStates">
                                <vsm:VisualState x:Name="Hidden">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="root"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Shown" />
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>


                        <Border CornerRadius="2" Background="{TemplateBinding Background}" BorderBrush="{StaticResource Brush1}"
                                BorderThickness="1"/>
                        <Border x:Name="Hover" CornerRadius="2" Background="#50000000"
                                BorderThickness="0" Opacity="0"/>
                        <Border x:Name="Select" CornerRadius="2" Background="{StaticResource Brush3}" 
                                BorderBrush="{StaticResource Brush1}" Opacity="0"
                                BorderThickness="1"/>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="Charting:Chart">
        <Setter Property="Foreground" Value="{StaticResource Brush2}"/>
        <Setter Property="BorderBrush" Value="{StaticResource Brush4}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="FontFamily" Value="{StaticResource FontFamily1}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize1}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="Background" Value="{StaticResource Brush5}"/>
        <Setter Property="Palette">
            <Setter.Value>
                <charttoolkit:ResourceDictionaryCollection>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="Goldenrod"/>
                        </Style>                        
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="Beige"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="GreenYellow"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="Honeydew"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="LemonChiffon"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="Green"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="Bisque"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="LightSteelBlue"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="LightYellow"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="MediumBlue"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="DimGray"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="DarkOrchid"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="DarkOrange"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="LightSkyBlue"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control" BasedOn="{StaticResource DataPointStyle1}">
                            <Setter Property="Background" Value="Peru"/>
                        </Style>
                    </ResourceDictionary>
                </charttoolkit:ResourceDictionaryCollection>
            </Setter.Value>
        </Setter>

        <Setter Property="TitleStyle">
            <Setter.Value>
                <Style TargetType="charttoolkit:Title">
                    <Setter Property="FontSize" Value="{StaticResource FontSize3}"/>
                    <Setter Property="HorizontalAlignment" Value="Center"/>
                    <Setter Property="Margin" Value="0 5"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="LegendStyle">
            <Setter.Value>
                <Style TargetType="charttoolkit:Legend">
                    <Setter Property="Margin" Value="5 0"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="BorderThickness" Value="0"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ChartAreaStyle">
            <Setter.Value>
                <Style TargetType="Panel">
                    <Setter Property="MinWidth" Value="100"/>
                    <Setter Property="MinHeight" Value="75"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="PlotAreaStyle">
            <Setter.Value>
                <Style TargetType="Grid">
                    <Setter Property="Background" Value="{StaticResource Brush19}"/>
                </Style>
            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Charting:Chart">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                            Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" CornerRadius="4">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            
                            <charttoolkit:Title Content="{TemplateBinding Title}" Style="{TemplateBinding TitleStyle}"/>
                            
                            <Grid Margin="0,15,0,15" Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                
                                <charttoolkit:Legend x:Name="Legend" Grid.Column="1" Header="{TemplateBinding LegendTitle}" 
                                                     Style="{TemplateBinding LegendStyle}"/>
                                
                                <Charting_Primitives:EdgePanel x:Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}">
                                    <Grid Style="{TemplateBinding PlotAreaStyle}" Canvas.ZIndex="-1"/>
                                    <Border BorderBrush="{StaticResource Brush1}" BorderThickness="1" 
                                            CornerRadius="3" Canvas.ZIndex="10"/>
                                </Charting_Primitives:EdgePanel>
                                
                            </Grid>
                            
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--dataform-->
    <Style TargetType="dataformtoolkit:DataForm">
        <Setter Property="AutoCommit" Value="True"/>
        <Setter Property="AutoGenerateFields" Value="True"/>
        <Setter Property="FontFamily" Value="{StaticResource FontFamily1}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize1}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{StaticResource Brush2}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="BorderBrush" Value="{StaticResource Brush4}"/>
        <Setter Property="DescriptionViewerPosition" Value="Auto"/>
        <Setter Property="LabelPosition" Value="Auto"/>
        <Setter Property="HeaderVisibility" Value="Visible"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dataformtoolkit:DataForm">
                    <Grid x:Name="root" dataformtoolkit:DataField.IsFieldGroup="True">                        
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="root"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0" To="{StaticResource OpacityDisable}"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ModeStates">
                                <VisualState x:Name="ReadOnly"/>
                                <VisualState x:Name="Empty">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="IsHitTestVisible" 
                                                                       Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" 
                                                         Storyboard.TargetName="ContentPresenter"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Edit">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="IsEnabled" 
                                                                       Storyboard.TargetName="EditButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="false"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" 
                                                                       Storyboard.TargetName="CommitButton">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" 
                                                                       Storyboard.TargetName="CancelButton">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid"/>
                                <VisualState x:Name="Invalid">

                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" 
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" 
                                                                       Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommittedStates">
                                <VisualState x:Name="Committed"/>
                                <VisualState x:Name="Uncommitted">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.9" Storyboard.TargetProperty="Opacity" 
                                                         Storyboard.TargetName="ChangeIndicator"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ScopeStates">
                                <VisualState x:Name="Entity"/>
                                <VisualState x:Name="Collection"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        
                        <Border x:Name="DataFormBorder" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="4"
                                BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                
                                <Grid MinHeight="27" Visibility="{TemplateBinding HeaderVisibility}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="8"/>
                                    </Grid.ColumnDefinitions>
                                    
                                    <StackPanel Orientation="Horizontal">
                                        <ContentControl x:Name="HeaderElement" ContentTemplate="{TemplateBinding HeaderTemplate}" 
                                                        Content="{TemplateBinding Header}" Foreground="{TemplateBinding Foreground}" 
                                                        FontWeight="Bold" Margin="10,0,0,0" VerticalAlignment="Center"/>
                                        <TextBlock x:Name="ChangeIndicator" Foreground="{TemplateBinding Foreground}" 
                                                   FontWeight="Bold" Margin="3,-2,8,2" Opacity="0" Text="*" VerticalAlignment="Center"/>
                                    </StackPanel>
                                    
                                    <StackPanel Grid.Column="2" Margin="0,3,0,2" Orientation="Horizontal">
                                        <Button x:Name="FirstItemButton" Margin="1 0">
                                            <Grid Height="9" Margin="6,5,5,5" Opacity="1" Width="8">
                                                <Grid.OpacityMask>
                                                    <LinearGradientBrush EndPoint="0.6,1" StartPoint="0.4,0">
                                                        <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                        <GradientStop Color="#BF000000" Offset="0.25"/>
                                                        <GradientStop Color="#FF000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Grid.OpacityMask>
                                                <Grid.Effect>
                                                    <DropShadowEffect BlurRadius="8" Color="#FFFFFFFF" Direction="100" Opacity="1" ShadowDepth="0"/>
                                                </Grid.Effect>
                                                <Path Data="M1,0 L1,2 L0,1 Z" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Right" Height="9" Margin="0" Opacity="0.85" Stretch="Fill" Width="5"/>
                                                <Rectangle Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Opacity="0.85" Width="2"/>
                                            </Grid>
                                        </Button>
                                        <Button x:Name="PreviousItemButton" Margin="1 0">
                                            <Path Data="M1,0 L1,2 L0,1 Z" Fill="{TemplateBinding Foreground}" Height="9" Margin="6,5,8,5" Opacity="0.85" Stretch="Fill" Width="5">
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="8" Color="#FFFFFFFF" Direction="100" ShadowDepth="0"/>
                                                </Path.Effect>
                                                <Path.OpacityMask>
                                                    <LinearGradientBrush EndPoint="0.6,1" StartPoint="0.4,0">
                                                        <GradientStop Color="#7F000000" Offset="0"/>
                                                        <GradientStop Color="#BF000000" Offset="0.25"/>
                                                        <GradientStop Color="#FF000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Path.OpacityMask>
                                            </Path>
                                        </Button>
                                        <Button x:Name="NextItemButton" Margin="1 0">
                                            <Path Data="M0,0 L1,1 L0,2 Z" Fill="{TemplateBinding Foreground}" Height="9" Margin="8,5,6,5" Opacity="0.85" Stretch="Fill" Width="5">
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="8" Color="#FFFFFFFF" Direction="100" ShadowDepth="0"/>
                                                </Path.Effect>
                                                <Path.OpacityMask>
                                                    <LinearGradientBrush EndPoint="0.6,1" StartPoint="0.4,0">
                                                        <GradientStop Color="#7F000000" Offset="0"/>
                                                        <GradientStop Color="#BF000000" Offset="0.25"/>
                                                        <GradientStop Color="#FF000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Path.OpacityMask>
                                            </Path>
                                        </Button>
                                        <Button x:Name="LastItemButton" Margin="1 0">
                                            <Grid Height="9" Margin="6,5,5,5" Opacity="1" Width="8">
                                                <Grid.OpacityMask>
                                                    <LinearGradientBrush EndPoint="0.6,1" StartPoint="0.4,0">
                                                        <GradientStop Color="#7F000000" Offset="0"/>
                                                        <GradientStop Color="#BF000000" Offset="0.25"/>
                                                        <GradientStop Color="#FF000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Grid.OpacityMask>
                                                <Grid.Effect>
                                                    <DropShadowEffect BlurRadius="8" Color="#FFFFFFFF" Direction="100" ShadowDepth="0"/>
                                                </Grid.Effect>
                                                <Path Data="M0,0 L1,1 L0,2 Z" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Height="9" Opacity="0.85" Stretch="Fill" Width="5"/>
                                                <Rectangle Fill="{TemplateBinding Foreground}" HorizontalAlignment="Right" Opacity="0.85" Width="2"/>
                                            </Grid>
                                        </Button>
                                        <Border x:Name="ButtonSeparator" BorderBrush="#59FFFFFF" BorderThickness="1,0,1,0" 
                                                Background="{TemplateBinding BorderBrush}" Margin="2,4,2,4" Opacity="0.2" Width="3"/>
                                        <Button x:Name="EditButton" ToolTipService.ToolTip="Edit" Margin="1 0">
                                            <Button.OpacityMask>
                                                <LinearGradientBrush EndPoint="0.57,0.76" StartPoint="0.42,0.01">
                                                    <GradientStop Color="#7F000000" Offset="0"/>
                                                    <GradientStop Color="#BF000000" Offset="0.442"/>
                                                    <GradientStop Color="#FF000000" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Button.OpacityMask>
                                            <Grid HorizontalAlignment="Center" Height="19" VerticalAlignment="Center" Width="19">
                                                <Canvas HorizontalAlignment="Stretch" Margin="2,2,0,0" VerticalAlignment="Stretch">
                                                    <Path Data="F1 M 2.53,9.96L 4.96,11.1L 6.08,13.50L 13.09,6.50L 9.6,3L 2.53,9.96 Z " Fill="{TemplateBinding Foreground}" Height="10.5" Canvas.Left="2.53" Stretch="Fill" Canvas.Top="3.01" Width="10.56">
                                                        <Path.OpacityMask>
                                                            <LinearGradientBrush EndPoint="0.76,0.77" StartPoint="0.21,0.18">
                                                                <GradientStop Color="#7F000000" Offset="0"/>
                                                                <GradientStop Color="#59000000" Offset="0.106"/>
                                                                <GradientStop Color="#3F000000" Offset="0.387"/>
                                                                <GradientStop Color="#99000000" Offset="0.703"/>
                                                                <GradientStop Color="#CC000000" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Path.OpacityMask>
                                                    </Path>
                                                    <Path Data="M1.41,1.83 L0.71,2.54 L4.20,6.03 L4.91,5.33 z M3.24,0 L6.81,3.42 L3.5,6.74 L0,3.24 z" Fill="{TemplateBinding Foreground}" Height="6.74" Canvas.Left="7.47" Stretch="Fill" Canvas.Top="1.89" Width="6.81"/>
                                                    <Path Data="F1 M 13.77,4.22L 11.73,2.18C 11.12,1.78 10.46,2.15 10,2.5L 3.04,9.45C 2.65,9.86 2.53,10.47 2.53,10.73L 2.53,13.5L 5.32,13.5C 5.57,13.5 6.33,13.36 6.64,12.93L 13.54,6.03C 13.86,5.72 14.17,4.74 13.77,4.22 Z" Height="12.5" Canvas.Left="2.03" Stretch="Fill" Stroke="{TemplateBinding Foreground}" StrokeLineJoin="Round" Canvas.Top="1.50" Width="12.43"/>
                                                    <Path Data="F1 M 2.033,11.71L 4.33,14L 2.62,14C 2.17,13.93 2.09,13.79 2,13.31L 2.03,11.71 Z" Fill="{TemplateBinding Foreground}" Height="2.29" Canvas.Left="2.58" Stretch="Fill" Canvas.Top="11.18" Width="2.33"/>
                                                </Canvas>
                                            </Grid>
                                        </Button>
                                        <Button x:Name="NewItemButton" Margin="1 0" ToolTipService.ToolTip="Add">
                                            <Path Data="F1 M18.41,61.67 L19.56,60.52 L21.92,62.88 L24.22,60.57 L25.36,61.72 L23.06,64.03 L25.43,66.4 L24.22,67.60 L21.87,65.25 L19.56,67.56 L18.41,66.41 L20.73,64.08 L18.41,61.67 z" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Center" Height="9" Margin="5" Opacity="0.85" RenderTransformOrigin="0.5,0.5" Stretch="Fill" VerticalAlignment="Center" Width="9">
                                                <Path.RenderTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform/>
                                                        <SkewTransform/>
                                                        <RotateTransform Angle="45"/>
                                                        <TranslateTransform X="0.18" Y="-0.07"/>
                                                    </TransformGroup>
                                                </Path.RenderTransform>
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="8" Color="#FFFFFFFF" Direction="100" ShadowDepth="0"/>
                                                </Path.Effect>
                                                <Path.OpacityMask>
                                                    <LinearGradientBrush EndPoint="0.35,0.5" StartPoint="-0.27,0.05">
                                                        <GradientStop Color="#7F000000" Offset="0"/>
                                                        <GradientStop Color="#BF000000" Offset="0.25"/>
                                                        <GradientStop Color="#FF000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Path.OpacityMask>
                                            </Path>
                                        </Button>
                                        <Button x:Name="DeleteItemButton" Margin="1 0" ToolTipService.ToolTip="Delete">
                                            <Path Data="F1 M24.32,60.48 L25.60,61.76 L19.65,67.75 L18.37,66.46 z" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Center" Height="9" Margin="5,5,5,5" Opacity="0.85" RenderTransformOrigin="0.5,0.5" Stretch="Fill" VerticalAlignment="Center" Width="9">
                                                <Path.RenderTransform>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="45"/>
                                                        <TranslateTransform X="0.06" Y="-0.01"/>
                                                    </TransformGroup>
                                                </Path.RenderTransform>
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="8" Color="#FFFFFFFF" Direction="100" ShadowDepth="0"/>
                                                </Path.Effect>
                                                <Path.OpacityMask>
                                                    <LinearGradientBrush EndPoint="0.74,0.66" StartPoint="-0.44,-0.11">
                                                        <GradientStop Color="#7F000000" Offset="0"/>
                                                        <GradientStop Color="#BF000000" Offset="0.25"/>
                                                        <GradientStop Color="#FF000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Path.OpacityMask>
                                            </Path>
                                        </Button>
                                    </StackPanel>
                                </Grid>
                                
                                <ScrollViewer Background="{x:Null}" IsTabStop="False" Padding="{TemplateBinding Padding}" 
                                              Grid.Row="1"
                                              VerticalScrollBarVisibility="Auto">
                                    <ContentPresenter x:Name="ContentPresenter" Margin="12,12,6,12"/>
                                </ScrollViewer>
                                <dataInput:ValidationSummary x:Name="ValidationSummary" BorderThickness="0" 
                                                             MaxHeight="100" Grid.Row="2"/>
                                <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="3">
                                    <Button x:Name="CommitButton" Content="OK" HorizontalContentAlignment="Center" 
                                            Margin="0,5,8,5" MinWidth="71" MinHeight="17" Visibility="Collapsed" 
                                            VerticalContentAlignment="Center"/>
                                    <Button x:Name="CancelButton" Content="Cancel" HorizontalContentAlignment="Center" 
                                            Margin="0,5,8,5" MinWidth="71" MinHeight="17" Visibility="Collapsed" 
                                            VerticalContentAlignment="Center"/>
                                </StackPanel>
                            </Grid>
                        </Border>
                        
                        <Border x:Name="ValidationErrorElement" BorderBrush="{StaticResource Brush8}" 
                                BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip" 
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" 
                                         Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" 
                                         Template="{StaticResource ValidationToolTipTemplate}">
                                    <ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" 
                                                                                   Storyboard.TargetName="validationTooltip">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="true" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            
                            <Grid Background="Transparent" HorizontalAlignment="Right" Height="10" Margin="0,-4,-4,0" 
                                  VerticalAlignment="Top" Width="10">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="{StaticResource Brush8}" Margin="-1,3,0,0"/>
                                <Path Data="M 0,0 L2,0 L 8,6 L8,8" Fill="#ffffff" Margin="-1,3,0,0"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--busyindicator-->
    <Style TargetType="toolkit:BusyIndicator">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Background" Value="{StaticResource Brush5}"/>
        <Setter Property="BusyContent" Value="Please wait..."/>
        <Setter Property="FontFamily" Value="{StaticResource FontFamily1}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize1}"/>
        <Setter Property="Foreground" Value="{StaticResource Brush2}"/>
        <Setter Property="DisplayAfter" Value="00:00:00.1"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="OverlayStyle">
            <Setter.Value>
                <Style TargetType="Rectangle">
                    <Setter Property="Fill" Value="White"/>
                    <Setter Property="Opacity" Value="0.6"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ProgressBarStyle">
            <Setter.Value>
                <Style TargetType="ProgressBar">
                    <Setter Property="Background" Value="{StaticResource Brush1}"/>
                    <Setter Property="Foreground" Value="{StaticResource Brush2}"/>
                    <Setter Property="IsIndeterminate" Value="True"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ProgressBar">
                                <Grid>
                                    <vsm:VisualStateManager.VisualStateGroups>
                                        <vsm:VisualStateGroup x:Name="CommonStates">
                                            <vsm:VisualState x:Name="Determinate"/>
                                            <vsm:VisualState x:Name="Indeterminate">
                                                <Storyboard BeginTime="0:0:0.15" Duration="0:0:2.4" RepeatBehavior="Forever" >
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="p1" Storyboard.TargetProperty="Opacity">
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.15" Value="0"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.26" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.35" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.46" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="p2" Storyboard.TargetProperty="Opacity">
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.30" Value="0"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.41" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.50" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.61" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="p3" Storyboard.TargetProperty="Opacity">
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.45" Value="0"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.56" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.65" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.76" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="p4" Storyboard.TargetProperty="Opacity">
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.60" Value="0"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.71" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.80" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.91" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="p5" Storyboard.TargetProperty="Opacity">
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.75" Value="0"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.86" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.95" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:2.06" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="p6" Storyboard.TargetProperty="Opacity">
                                                        <LinearDoubleKeyFrame KeyTime="0:0:0.90" Value="0"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.01" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:2.10" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:2.21" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="p7" Storyboard.TargetProperty="Opacity">
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.05" Value="0"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.16" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:2.25" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:2.36" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="p8" Storyboard.TargetProperty="Opacity">
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.20" Value="0"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:1.31" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:2.40" Value="1"/>
                                                        <LinearDoubleKeyFrame KeyTime="0:0:2.40" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                    </vsm:VisualStateManager.VisualStateGroups>

                                    <Viewbox>
                                        <Grid Height="35" Width="35">
                                            <Path x:Name="p5" Opacity="0" 
                                                  Data="M5.3666506,0.5000003 L5.7133517,0.72223777 C6.6946535,1.3184171 7.7845569,1.7536836 8.9464264,1.9914073 L8.9809875,1.998026 L8.9809875,8.876935 L8.8369169,8.8604708 C5.7175508,8.4639959 2.862067,7.2222071 0.50738931,5.3719926 L0.5,5.3660407 z" 
                                                  Margin="6.496,0,0,0.124" Stretch="Fill" Stroke="#FF7E7E7E" UseLayoutRounding="False" 
                                                  HorizontalAlignment="Left" Height="9.377" VerticalAlignment="Bottom" Width="9.481" 
                                                  StrokeThickness="0" Fill="{TemplateBinding Background}"/>
                                            <Path x:Name="p4" Opacity="0" Data="M4.1121063,0.5000006 L8.9784365,5.3657207 L8.9678411,5.3742528 C6.6131639,7.2244673 3.7576799,8.4662561 0.63831252,8.862731 L0.50000048,8.8785391 L0.50000048,1.999184 L0.52880186,1.9936675 C1.6906725,1.7559438 2.7805767,1.3206773 3.761878,0.72449797 z" Margin="0,0,6.497,0.124" Stretch="Fill" Stroke="#FF7E7E7E" UseLayoutRounding="False" HorizontalAlignment="Right" Height="9.379" VerticalAlignment="Bottom" Width="9.478" StrokeThickness="0"
                                                  Fill="{TemplateBinding Background}"/>
                                            <Path x:Name="p3" Opacity="0" Data="M1.9976557,0.5 L8.8776493,0.5 L8.8615131,0.64116967 C8.4649878,3.7601461 7.2230439,6.615272 5.3725972,8.969655 L5.366652,8.9770346 L0.5,4.110992 L0.7222597,3.7643437 C1.3185138,2.7831655 1.7538347,1.6933979 1.9915864,0.53167284 z" Margin="0,0,0.124,6.499" Stretch="Fill" Stroke="#FF7E7E7E" UseLayoutRounding="False" HorizontalAlignment="Right" Height="9.477" VerticalAlignment="Bottom" Width="9.378" StrokeThickness="0"
                                                  Fill="{TemplateBinding Background}"/>
                                            <Path x:Name="p6" Opacity="0" Data="M0.5,0.5 L7.3799934,0.5 L7.3860626,0.53167284 C7.623816,1.6933979 8.0591364,2.7831655 8.6553907,3.7643437 L8.8799105,4.1145191 L4.0135803,8.9802399 L4.0050535,8.969655 C2.1546073,6.615272 0.91266096,3.7601461 0.51613933,0.64116967 z" Margin="0.12,0,0,6.496" Stretch="Fill" Stroke="#FF7E7E7E" UseLayoutRounding="False" HorizontalAlignment="Left" Height="9.48" VerticalAlignment="Bottom" Width="9.38" StrokeThickness="0"
                                                  Fill="{TemplateBinding Background}"/>
                                            <Path x:Name="p2" Opacity="0" Data="M5.3666501,0.50000006 L5.3726025,0.50738847 C7.2230492,2.8617713 8.4649935,5.7168975 8.8615189,8.8358727 L8.877655,8.9770498 L1.9976631,8.9770498 L1.991592,8.9453697 C1.7538403,7.7836447 1.3185194,6.6938791 0.72226524,5.7126989 L0.5,5.3660417 z" Margin="0,6.499,0.124,0" Stretch="Fill" Stroke="#FF7E7E7E" UseLayoutRounding="False" HorizontalAlignment="Right" Height="9.477" VerticalAlignment="Top" Width="9.378" StrokeThickness="0"
                                                  Fill="{TemplateBinding Background}"/>
                                            <Path x:Name="p7" Opacity="0" Data="M4.013588,0.50000024 L8.8799181,5.3657212 L8.6553917,5.7159047 C8.0591364,6.6970849 7.6238165,7.7868505 7.3860636,8.948576 L7.379993,8.9802561 L0.5,8.9802561 L0.51614022,8.8390789 C0.91266179,5.7201033 2.154608,2.8649771 4.0050545,0.51059425 z" Margin="0.12,6.496,0,0" Stretch="Fill" Stroke="#FF7E7E7E" UseLayoutRounding="False" HorizontalAlignment="Left" Height="9.48" VerticalAlignment="Top" Width="9.38" StrokeThickness="0"
                                                  Fill="{TemplateBinding Background}"/>
                                            <Path x:Name="p1" Opacity="0" Data="M0.50000048,0.5 L0.63831252,0.5158087 C3.7576799,0.91228062 6.6131639,2.1540713 8.9678411,4.0042858 L8.9784269,4.0128117 L4.1120973,8.8785334 L3.761878,8.6540403 C2.7805767,8.0578604 1.6906725,7.6225948 0.52880186,7.3848715 L0.50000048,7.379354 z" Margin="0,0.125,6.497,0" Stretch="Fill" Stroke="#FF7E7E7E" UseLayoutRounding="False" HorizontalAlignment="Right" Height="9.379" VerticalAlignment="Top" Width="9.478" StrokeThickness="0"
                                                  Fill="{TemplateBinding Background}"/>
                                            <Path x:Name="p8" Opacity="0" Data="M8.9809799,0.5 L8.9809799,7.3789091 L8.9464188,7.3855295 C7.7845492,7.6232529 6.6946459,8.0585184 5.7133441,8.6546984 L5.366652,8.8769302 L0.50000006,4.0108881 L0.50738156,4.0049438 C2.8620591,2.1547294 5.7175431,0.91293871 8.8369093,0.5164668 z" Margin="6.496,0.124,0,0" Stretch="Fill" Stroke="#FF7E7E7E" UseLayoutRounding="False" HorizontalAlignment="Left" Height="9.377" VerticalAlignment="Top" Width="9.481" StrokeThickness="0"
                                                  Fill="{TemplateBinding Background}"/>
                                        </Grid>
                                    </Viewbox>
                                </Grid>

                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:BusyIndicator">
                    <Grid>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="VisibilityStates">
                                <VisualState x:Name="Hidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="busycontent">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="overlay">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Visible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="busycontent">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="overlay">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BusyStatusStates">
                                <VisualState x:Name="Idle">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="content">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Busy">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="content">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>False</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <ContentControl x:Name="content" Content="{TemplateBinding Content}" 
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                            ContentTemplate="{TemplateBinding ContentTemplate}"/>

                        <Rectangle x:Name="overlay" Style="{TemplateBinding OverlayStyle}" d:IsHidden="True"/>

                        <ContentPresenter x:Name="busycontent">
                            <Border Background="{TemplateBinding Background}" CornerRadius="4" HorizontalAlignment="Center"
                                VerticalAlignment="Center">
                                <Border.Effect>
                                    <DropShadowEffect Opacity="0.6" BlurRadius="6" ShadowDepth="0" />
                                </Border.Effect>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>

                                    <ContentControl Content="{TemplateBinding BusyContent}" HorizontalAlignment="Center"
                                            VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}"
                                            FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"
                                            ContentTemplate="{TemplateBinding BusyContentTemplate}" Grid.Row="0" Margin="5 5 5 2"/>

                                    <ProgressBar Style="{TemplateBinding ProgressBarStyle}" Height="45" Width="45" Grid.Row="2"
                                         IsIndeterminate="True" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5 2 5 5"/>
                                </Grid>
                            </Border>
                        </ContentPresenter>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--expander-->
    <Style TargetType="toolkit:Expander">
        <Setter Property="FontFamily" Value="{StaticResource FontFamily1}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize1}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{StaticResource Brush2}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="BorderBrush" Value="{StaticResource Brush4}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:Expander">
                    <Grid x:Name="root">
                        <Grid.Resources>
                            <ControlTemplate x:Key="ExpandButtonTemplate" TargetType="ToggleButton">
                                <Grid x:Name="root" Background="Transparent">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <vsm:VisualStateManager.VisualStateGroups>
                                        <vsm:VisualStateGroup x:Name="CommonStates">
                                            <vsm:VisualState x:Name="Normal"/>
                                            <vsm:VisualState x:Name="MouseOver">

                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Pressed">

                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetName="root"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0" To="{StaticResource OpacityDisable}"/>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="CheckStates">
                                            <vsm:VisualState x:Name="Checked">
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetName="CheckIcon" 
                                                         Storyboard.TargetProperty="(UIElement.Opacity)" 
                                                         Duration="0" To="1"/>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Unchecked"/>
                                        </vsm:VisualStateGroup>
                                    </vsm:VisualStateManager.VisualStateGroups>

                                    <Grid Width="16" Height="16" Margin="3">

                                        <Ellipse x:Name="Border" Fill="{StaticResource Brush5}" 
                                                StrokeThickness="2"
                                                Stroke="{StaticResource Brush4}"/>

                                        <Ellipse x:Name="CheckIcon" Margin="4" Fill="{StaticResource Brush1}" Stretch="Fill" Opacity="0" />
                                    </Grid>

                                    <ContentPresenter Grid.Column="1"
                                                      x:Name="contentPresenter"
                                                      Content="{TemplateBinding Content}"
                                                      ContentTemplate="{TemplateBinding ContentTemplate}"
                                                      HorizontalAlignment="Left"
                                                      VerticalAlignment="Center"
                                                      Margin="{TemplateBinding Padding}"/>
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>
                        
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="{StaticResource OpacityDisable}" 
                                                         Storyboard.TargetProperty="Opacity" 
                                                         Storyboard.TargetName="root"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Collapsed"/>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" 
                                                                       Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpandDirectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="ExpandDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandUp">
                                    <Storyboard>
                                        <!--<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Template" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderUpHeaderTemplate}"/>
                                        </ObjectAnimationUsingKeyFrames>-->
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandLeft">
                                    <Storyboard>
                                        <!--<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Template" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderLeftHeaderTemplate}"/>
                                        </ObjectAnimationUsingKeyFrames>-->
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandRight">
                                    <Storyboard>
                                        <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Template" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderRightHeaderTemplate}"/>
                                        </ObjectAnimationUsingKeyFrames>-->
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}" CornerRadius="4">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition x:Name="rd0" Height="Auto"/>
                                    <RowDefinition x:Name="rd1" Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="cd0" Width="Auto"/>
                                    <ColumnDefinition x:Name="cd1" Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                
                                <ToggleButton x:Name="ExpanderButton" ContentTemplate="{TemplateBinding HeaderTemplate}"
                                              Content="{TemplateBinding Header}" Grid.Column="0" HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch" Template="{StaticResource ExpandButtonTemplate}"
                                              Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" 
                                              FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" 
                                              FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" 
                                              HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                              IsChecked="{TemplateBinding IsExpanded}" MinWidth="0" MinHeight="0" 
                                              Padding="{TemplateBinding Padding}" Grid.Row="0"
                                              VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                
                                <ContentControl x:Name="ExpandSite" ContentTemplate="{TemplateBinding ContentTemplate}" 
                                                Content="{TemplateBinding Content}" Grid.Column="0" Foreground="{TemplateBinding Foreground}" 
                                                FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" 
                                                FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" 
                                                FontFamily="{TemplateBinding FontFamily}"
                                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                Margin="{TemplateBinding Padding}" Grid.Row="1" Visibility="Collapsed"
                                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Grid>
                        </Border>
                        
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--accordion-->
    <Style TargetType="System_Windows_Controls:Accordion">
        <Setter Property="Background" Value="{StaticResource Brush5}"/>
        <Setter Property="Foreground" Value="{StaticResource Brush2}"/>
        <Setter Property="FontFamily" Value="{StaticResource FontFamily1}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize1}"/>
        <Setter Property="BorderBrush" Value="{StaticResource Brush4}"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="Cursor" Value="Arrow"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="TabNavigation" Value="Once"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel VerticalAlignment="Top"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="System_Windows_Controls:Accordion">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity"
                                                         To="{StaticResource OpacityDisable}"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="4"
                                    BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
                                    Padding="{TemplateBinding Padding}">
                                <ScrollViewer BorderBrush="Transparent" BorderThickness="0" Background="{x:Null}" 
                                              HorizontalScrollBarVisibility="Disabled" IsTabStop="False" Margin="0" Padding="0" 
                                              VerticalScrollBarVisibility="Disabled">
                                    <ItemsPresenter/>
                                </ScrollViewer>
                            </Border>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Value="{x:Null}" Property="Background"/>
    </Style>

    <Style TargetType="layouttoolkit:AccordionButton">
        <Setter Property="BorderBrush" Value="{StaticResource Brush1}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="TabNavigation" Value="Once"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="layouttoolkit:AccordionButton">
                    <Grid x:Name="root" Margin="{TemplateBinding Padding}">
                        <VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Hover"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0:0:0.1" To="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Hover"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0:0:0.1" To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Hover"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0:0:0.02" To="0"/>
                                        <DoubleAnimation Storyboard.TargetName="Click"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0:0:0.02" To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="CheckStates">
                                <vsm:VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Background"
                                                         Storyboard.TargetProperty="(Background).(LinearGradientBrush.GradientStops)[3].(GradientStop.Offset)"
                                                         Duration="0" To="0.05"/>
                                        <ColorAnimation Storyboard.TargetName="Background"
                                                         Storyboard.TargetProperty="(Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                         Duration="0" To="#FFFBFBFB"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unchecked"/>
                            </vsm:VisualStateGroup>
                            <VisualStateGroup x:Name="ExpandDirectionStates">
                                <VisualState x:Name="ExpandDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="icon">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="icon">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="00:00:00" To="-90" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="arrow" From="35"/>

                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandUp">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="icon">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="icon">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00" To="90" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="arrow"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="icon">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0,0,0,-4</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="icon">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="icon">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="90"/>
                                                    </TransformGroup>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="arrow"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="icon">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="icon">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="header">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="-90"/>
                                                    </TransformGroup>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00" To="180" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="arrow"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00.3" To="0" 
                                                         Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="icon"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        
                                        <DoubleAnimation BeginTime="00:00:00" Duration="0:0:0.3" To="90" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="icon"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border BorderThickness="1" CornerRadius="4" BorderBrush="{StaticResource Brush10}"/>

                        <Border x:Name="Background" BorderThickness="0" CornerRadius="3" BorderBrush="{StaticResource Brush11}"
                                    Background="{StaticResource Brush12}" Margin="1"/>

                        <Border x:Name="Click" CornerRadius="3" Background="{StaticResource Brush14}" Opacity="0"
                                Margin="1"/>

                        <Border x:Name="Hover" Background="{StaticResource Brush13}" Opacity="0"/>

                        <Grid>
                            <Grid Background="Transparent">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="cd0" Width="Auto"/>
                                    <ColumnDefinition x:Name="cd1" Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition x:Name="rd0" Height="Auto"/>
                                    <RowDefinition x:Name="rd1" Height="Auto"/>
                                </Grid.RowDefinitions>

                                <Grid x:Name="icon" Grid.Column="0" HorizontalAlignment="Center" Height="19" Grid.Row="0"
                                          RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" Width="19">
                                    <Grid.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform/>
                                            <SkewTransform/>
                                            <RotateTransform Angle="-90"/>

                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </Grid.RenderTransform>

                                    <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Height="Auto" 
                                              Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5" Stroke="{TemplateBinding BorderBrush}" 
                                              StrokeThickness="2" 
                                              VerticalAlignment="Center" Width="Auto">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform/>
                                                <SkewTransform/>
                                                <RotateTransform/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>

                                </Grid>

                                <System_Windows_Controls:LayoutTransformer x:Name="header" ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                               Content="{TemplateBinding Content}" Grid.Column="1" 
                                                                               Foreground="{TemplateBinding Foreground}"
                                                                               FontWeight="{TemplateBinding FontWeight}"
                                                                               FontStyle="{TemplateBinding FontStyle}" 
                                                                               FontStretch="{TemplateBinding FontStretch}"
                                                                               FontSize="{TemplateBinding FontSize}" 
                                                                               FontFamily="{TemplateBinding FontFamily}"
                                                                               HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                               Margin="4" Grid.Row="0" Grid.RowSpan="1"/>
                            </Grid>
                        </Grid>
                        
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="System_Windows_Controls:AccordionItem">
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="FontFamily" Value="{StaticResource FontFamily1}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize1}"/>
        <Setter Property="BorderBrush" Value="{x:Null}"/>
        <Setter Property="Background" Value="{StaticResource Brush5}"/>
        <Setter Property="Foreground" Value="{StaticResource Brush2}"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="System_Windows_Controls:AccordionItem">
                    <Grid Background="Transparent" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" 
                          VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(ExpandableContentControl.Percentage)" Storyboard.TargetName="ExpandSite">
                                            <SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:00.3" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00.3" Duration="00:00:00" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(ExpandableContentControl.Percentage)" Storyboard.TargetName="ExpandSite">
                                            <SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:00.3" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="LockedStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Locked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unlocked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpandDirectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="ExpandDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandUp">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.ColumnSpan)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.ColumnSpan)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.RowSpan)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.RowSpan)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.ColumnSpan)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.ColumnSpan)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.RowSpan)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.RowSpan)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        
                        <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" CornerRadius="3">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition x:Name="rd0" Height="Auto"/>
                                    <RowDefinition x:Name="rd1" Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="cd0" Width="Auto"/>
                                    <ColumnDefinition x:Name="cd1" Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                
                                <layouttoolkit:AccordionButton x:Name="ExpanderButton"
                                                               ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"
                                                               Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}"
                                                               FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" 
                                                               FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" 
                                                               HorizontalAlignment="Stretch"
                                                               HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                                               IsTabStop="True" IsChecked="{TemplateBinding IsSelected}" Margin="0,0,0,0" 
                                                               Padding="0,0,0,0" Grid.Row="0" VerticalAlignment="Stretch" 
                                                               VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                
                                <layouttoolkit:ExpandableContentControl x:Name="ExpandSite" ContentTemplate="{TemplateBinding ContentTemplate}" 
                                                                        Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" 
                                                                        FontWeight="{TemplateBinding FontWeight}"
                                                                        FontStyle="{TemplateBinding FontStyle}"
                                                                        FontStretch="{TemplateBinding FontStretch}"
                                                                        FontSize="{TemplateBinding FontSize}" 
                                                                        FontFamily="{TemplateBinding FontFamily}"
                                                                        HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                                                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                        IsTabStop="False" Margin="0,0,0,0" Percentage="0" 
                                                                        RevealMode="{TemplateBinding ExpandDirection}" Grid.Row="1" 
                                                                        Style="{TemplateBinding ExpandableContentControlStyle}" 
                                                                        VerticalAlignment="{TemplateBinding VerticalAlignment}"
                                                                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--contextmenu-->
    <Style TargetType="inputtoolkit:ContextMenu">
        <Setter Property="Background" Value="{StaticResource Brush5}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="{StaticResource Brush4}"/>
        <Setter Property="FontFamily" Value="{StaticResource FontFamily1}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize1}"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="inputtoolkit:ContextMenu">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                            Background="{TemplateBinding Background}" CornerRadius="3">
                        <Border.Effect>
                            <DropShadowEffect Color="Black" ShadowDepth="0" BlurRadius="6" Opacity=".6"/>
                        </Border.Effect>
                        <Grid>
                            <ItemsPresenter Margin="{TemplateBinding Padding}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="inputtoolkit2:MenuItem">
        <Setter Property="Background" Value="{StaticResource Brush12}"/>
        <Setter Property="Foreground" Value="{StaticResource Brush2}"/>
        <Setter Property="FontFamily" Value="{StaticResource FontFamily1}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize1}"/>
        <Setter Property="BorderBrush" Value="{StaticResource Brush4}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="inputtoolkit:MenuItem">
                    <Grid x:Name="root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" 
                                                         Storyboard.TargetName="Presenter"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" 
                                                                       Storyboard.TargetName="MouseOverBorder">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        
                        <Border x:Name="MouseOverBorder" CornerRadius="3" BorderThickness="1" 
                                BorderBrush="{TemplateBinding BorderBrush}" Opacity="0" 
                                Background="{TemplateBinding Background}"/>
                        
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition MinWidth="24" Width="Auto"/>
                                <ColumnDefinition Width="4"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="17"/>
                            </Grid.ColumnDefinitions>
                            
                            <ContentPresenter Content="{TemplateBinding Icon}" Margin="1" VerticalAlignment="Center"/>
                            <ContentPresenter x:Name="Presenter" ContentTemplate="{TemplateBinding HeaderTemplate}" 
                                              Content="{TemplateBinding Header}" Grid.Column="2" Margin="{TemplateBinding Padding}"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
